package com.yuxi.Service.Impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuxi.Config.ConfigStatic;
import com.yuxi.Dao.InformationOperationRecordDao;
import com.yuxi.Dao.Impl.UserInfoDaoImpl;
import com.yuxi.Entity.InformationOperationRecord;
import com.yuxi.Service.UserDoRecordService;
@Service
public class UserDoRecordServiceImpl implements UserDoRecordService {

	@Autowired
	private InformationOperationRecordDao  informationOperationRecordDao;
	private Logger logger=LoggerFactory.getLogger(UserDoRecordServiceImpl.class);
	@Override
	public InformationOperationRecord addUserDoRecord(InformationOperationRecord ioRecord) {		
		return informationOperationRecordDao.addORecord(ioRecord);		
	}

	@Override
	public void addUserLoginRecord(int userId, String ip,String name) {
		InformationOperationRecord ioRecord=new InformationOperationRecord(System.currentTimeMillis(), userId, name, ip, 0, ConfigStatic.DOTYPETABLE.get("UserLogin"), "登录记录");
		addUserDoRecord(ioRecord);		
	}

	@Override
	public InformationOperationRecord createUserDoRecord(int inId, int userId, String ip, int type,String doType,String name) {
		InformationOperationRecord ioRecord=new InformationOperationRecord(System.currentTimeMillis(), userId, name,ip, inId, type, doType);
		return addUserDoRecord(ioRecord);	
		
	}

}
